import { createWebHashHistory, createRouter } from 'vue-router'
const routes = [
    { path: '/', component: () => import('../views/index.vue') },
    { path: '/setting', component: () => import('../views/setting.vue') },
    { path: '/extension', component: () => import('../views/extension.vue') },
]
const router = createRouter({
    history: createWebHashHistory(),
    routes,
})
router.beforeEach((to, _, next) => {
    if (to.fullPath.includes('/extension') && to.query.name) {
        window.ipcRenderer?.send('pageExtension', to.query.name);
        next(false)
    } else {
        next()
    }
})
export default router